﻿using System;

namespace Mono.Cecil.Cil
{
	// Token: 0x02000127 RID: 295
	public struct OpCode : IEquatable<OpCode>
	{
		// Token: 0x170002E8 RID: 744
		// (get) Token: 0x06000B4D RID: 2893 RVA: 0x0003270C File Offset: 0x0003090C
		public string Name
		{
			get
			{
				return OpCodeNames.names[(int)this.Code];
			}
		}

		// Token: 0x170002E9 RID: 745
		// (get) Token: 0x06000B4E RID: 2894 RVA: 0x0003272C File Offset: 0x0003092C
		public int Size
		{
			get
			{
				return (this.op1 == byte.MaxValue) ? 1 : 2;
			}
		}

		// Token: 0x170002EA RID: 746
		// (get) Token: 0x06000B4F RID: 2895 RVA: 0x00032750 File Offset: 0x00030950
		public byte Op1
		{
			get
			{
				return this.op1;
			}
		}

		// Token: 0x170002EB RID: 747
		// (get) Token: 0x06000B50 RID: 2896 RVA: 0x00032768 File Offset: 0x00030968
		public byte Op2
		{
			get
			{
				return this.op2;
			}
		}

		// Token: 0x170002EC RID: 748
		// (get) Token: 0x06000B51 RID: 2897 RVA: 0x00032780 File Offset: 0x00030980
		public short Value
		{
			get
			{
				return (this.op1 == byte.MaxValue) ? ((short)this.op2) : ((short)((int)this.op1 << 8 | (int)this.op2));
			}
		}

		// Token: 0x170002ED RID: 749
		// (get) Token: 0x06000B52 RID: 2898 RVA: 0x000327B8 File Offset: 0x000309B8
		public Code Code
		{
			get
			{
				return (Code)this.code;
			}
		}

		// Token: 0x170002EE RID: 750
		// (get) Token: 0x06000B53 RID: 2899 RVA: 0x000327D0 File Offset: 0x000309D0
		public FlowControl FlowControl
		{
			get
			{
				return (FlowControl)this.flow_control;
			}
		}

		// Token: 0x170002EF RID: 751
		// (get) Token: 0x06000B54 RID: 2900 RVA: 0x000327E8 File Offset: 0x000309E8
		public OpCodeType OpCodeType
		{
			get
			{
				return (OpCodeType)this.opcode_type;
			}
		}

		// Token: 0x170002F0 RID: 752
		// (get) Token: 0x06000B55 RID: 2901 RVA: 0x00032800 File Offset: 0x00030A00
		public OperandType OperandType
		{
			get
			{
				return (OperandType)this.operand_type;
			}
		}

		// Token: 0x170002F1 RID: 753
		// (get) Token: 0x06000B56 RID: 2902 RVA: 0x00032818 File Offset: 0x00030A18
		public StackBehaviour StackBehaviourPop
		{
			get
			{
				return (StackBehaviour)this.stack_behavior_pop;
			}
		}

		// Token: 0x170002F2 RID: 754
		// (get) Token: 0x06000B57 RID: 2903 RVA: 0x00032830 File Offset: 0x00030A30
		public StackBehaviour StackBehaviourPush
		{
			get
			{
				return (StackBehaviour)this.stack_behavior_push;
			}
		}

		// Token: 0x06000B58 RID: 2904 RVA: 0x00032848 File Offset: 0x00030A48
		internal OpCode(int x, int y)
		{
			this.op1 = (byte)(x & 255);
			this.op2 = (byte)(x >> 8 & 255);
			this.code = (byte)(x >> 16 & 255);
			this.flow_control = (byte)(x >> 24 & 255);
			this.opcode_type = (byte)(y & 255);
			this.operand_type = (byte)(y >> 8 & 255);
			this.stack_behavior_pop = (byte)(y >> 16 & 255);
			this.stack_behavior_push = (byte)(y >> 24 & 255);
			bool flag = this.op1 == byte.MaxValue;
			if (flag)
			{
				OpCodes.OneByteOpCode[(int)this.op2] = this;
			}
			else
			{
				OpCodes.TwoBytesOpCode[(int)this.op2] = this;
			}
		}

		// Token: 0x06000B59 RID: 2905 RVA: 0x00032918 File Offset: 0x00030B18
		public override int GetHashCode()
		{
			return (int)this.Value;
		}

		// Token: 0x06000B5A RID: 2906 RVA: 0x00032930 File Offset: 0x00030B30
		public override bool Equals(object obj)
		{
			bool flag = !(obj is OpCode);
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				OpCode opCode = (OpCode)obj;
				result = (this.op1 == opCode.op1 && this.op2 == opCode.op2);
			}
			return result;
		}

		// Token: 0x06000B5B RID: 2907 RVA: 0x0003297C File Offset: 0x00030B7C
		public bool Equals(OpCode opcode)
		{
			return this.op1 == opcode.op1 && this.op2 == opcode.op2;
		}

		// Token: 0x06000B5C RID: 2908 RVA: 0x0003297C File Offset: 0x00030B7C
		public static bool operator ==(OpCode one, OpCode other)
		{
			return one.op1 == other.op1 && one.op2 == other.op2;
		}

		// Token: 0x06000B5D RID: 2909 RVA: 0x000329B0 File Offset: 0x00030BB0
		public static bool operator !=(OpCode one, OpCode other)
		{
			return one.op1 != other.op1 || one.op2 != other.op2;
		}

		// Token: 0x06000B5E RID: 2910 RVA: 0x000329E4 File Offset: 0x00030BE4
		public override string ToString()
		{
			return this.Name;
		}

		// Token: 0x04000628 RID: 1576
		private readonly byte op1;

		// Token: 0x04000629 RID: 1577
		private readonly byte op2;

		// Token: 0x0400062A RID: 1578
		private readonly byte code;

		// Token: 0x0400062B RID: 1579
		private readonly byte flow_control;

		// Token: 0x0400062C RID: 1580
		private readonly byte opcode_type;

		// Token: 0x0400062D RID: 1581
		private readonly byte operand_type;

		// Token: 0x0400062E RID: 1582
		private readonly byte stack_behavior_pop;

		// Token: 0x0400062F RID: 1583
		private readonly byte stack_behavior_push;
	}
}
